package com.cci.kangdao.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;
import java.util.Map;


/**
 * 角色表dao
 */
@MapperScan
public interface RoleChannelTDao {

    /**
     * 获取角色渠道列表
     *
     * @return
     */
    @Select("select * from RoleChannel_T where Flag = 0 order by Position asc")
    List<Map<String, Object>> getRoleChannelList();

    /**
     * 通过企业类型获取到渠道信息
     *
     * @param companyType
     * @return
     */
    @Select("select * from RoleChannel_T where Flag = 0 and CompanyType = #{companyType}")
    Map<String, Object> getRoleChannelByCompanyType(@Param("companyType") Integer companyType);

    /**
     * 通过企业ID获取到渠道信息
     *
     * @param companyId
     * @return
     */
    @Select("select * from RoleChannel_T where Flag = 0 and CompanyId = #{companyId}")
    Map<String, Object> getRoleChannelByCompanyId(@Param("companyId") Long companyId);

}
